<template>
	<view>
		<view v-if="form.currentState2 !=='ds_fq' && form.currentState2 !== 'sheng_fq'">
			<u-alert title="提示: 左划编辑下一流程" type="info" :closable="true" showIcon></u-alert>
		</view>
		<view class="information-change">
			<swiper duration="200" @change="change">
				<swiper-item>
					<u--form :model="form" :rules="rules" ref="form">
						<view class="information-change">
							<view class="content-view">
								<view class="content-item">
									<view class="content-item-left"><span class="required">*</span>隐患简题</view>
									<view class="content-item-right pr50">
										<u-form-item prop="troubleTitle" ref="item1">
											<u--input border="none" v-model="form.troubleTitle" color="#666666"
												fontSize="32rpx" inputAlign="right">
											</u--input>
										</u-form-item>
									</view>
								</view>
								<view class="content-item disabled">
									<view class="content-item-left ml35">隐患编号</view>
									<view class="content-item-right pr50">
										<u--input border="none" v-model="form.troubleNum" color="#666666"
											fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
										</u--input>
									</view>
								</view>
								<view class="content-item" @click="showPopupWorkFn(3)">
									<view class="content-item-left"><span class="required">*</span>隐患所在单位</view>
									<view class="content-item-right">
										<u--input border="none" v-model="form.troubleUnit" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="content-item">
									<!-- @click="showPicker(Level,0)" -->
									<view class="content-item-left"><span class="required">*</span>隐患等级</view>
									<view class="content-item-right" @click="showPicker(Level,0)">
										<u--input border="none" v-model="picker.zdGrade" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="content-item" @click="showPicker(typeList,1)">
									<view class="content-item-left"><span class="required">*</span>隐患分类</view>
									<view class="content-item-right">
										<u--input border="none" v-model="picker.specialtyAssort" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="content-item">
									<!-- @click="showPicker(bodyList,2)" -->
									<view class="content-item-left"><span class="required">*</span>隐患来源</view>
									<view class="content-item-right pr50">
										<u--input border="none" v-model="form.troubleSource" color="#666666"
											fontSize="32rpx" inputAlign="right">
										</u--input>
									</view>
								</view>
								<view class="content-item disabled">
									<view class="content-item-left"><span class="required">*</span>填报人</view>
									<view class="content-item-right pr50">
										<u--input border="none" v-model="form.createUser" color="#666666"
											fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
										</u--input>
									</view>
								</view>
								<view class="content-item disabled">
									<view class="content-item-left"><span class="required">*</span>填报人所属单位</view>
									<view class="content-item-right pr50">
										<u--input border="none" v-model="form.createOrg" color="#666666"
											fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
										</u--input>
									</view>
								</view>
								<view class="content-item" @click="showPopupFn(0)">
									<view class="content-item-left ml35">发现人</view>
									<view class="content-item-right">
										<u--input border="none" v-model="form.findPeople" color="#666666" disabled
											disabledColor="#ffffff" fontSize="32rpx" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="content-item" @click="showPopupWorkFn(0)">
									<view class="content-item-left ml35">发现人所属单位</view>
									<view class="content-item-right">
										<u--input border="none" v-model="form.findPeopleUnit" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="content-item disabled">
									<view class="content-item-left"><span class="required">*</span>填报时间</view>
									<view class="content-item-right">
										<u--input border="none" v-model="form.createDate" color="#666666"
											fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
										</u--input>
										<image src="../../static/iconCalendar.png" class="Calendar"></image>
									</view>
								</view>
								<view class="content-item" @click="calendar(2)">
									<view class="content-item-left"><span class="required">*</span>发现日期</view>
									<view class="content-item-right">
										<u--input border="none" v-model="picker.findDate" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<image src="../../static/iconCalendar.png" class="Calendar"></image>
									</view>
								</view>
								<view class="cont">
									<view class="content-item-left"><span class="required">*</span>隐患内容</view>
									<view class="content-item-right pr50 ml35">
										<u--textarea v-model="form.troubleContent" autoHeight></u--textarea>
									</view>
								</view>
								<view class="content-item" @click="showPopupWorkFn(2)">
									<view class="content-item-left ml35">归属职能部门</view>
									<view class="content-item-right">
										<u--input border="none" v-model="form.attachFunctDept" color="#666666"
											fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
										</u--input>
										<u-icon name="arrow-right" color="#333333" size="16"
											style="margin-left: 10rpx;">
										</u-icon>
									</view>
								</view>
								<view class="cont">
									<view class="content-item-left ml35">保养报告</view>
									<view class=" ml35">
										<view class="cob mt10" @click="checkAttac('080106')">查看附件列表</view>
										<files-upload @file="onUpload" classify="080106" :troubleId="form.troubleId">
										</files-upload>
									</view>
								</view>
							</view>
						</view>
					</u--form>
				</swiper-item>
				<swiper-item v-if="form.currentState2 !=='ds_fq' && form.currentState2 !== 'sheng_fq'">
					<view class="information-change">
						<view class="content-view">
							<!-- <view class="content-item">
								<view class="content-item-left">预评估等级</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="picker.priorEvaGrade" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
								</view>
							</view>
							<view class="content-item">
								<view class="content-item-left">预评估负责人</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.priorEvaPeople" disabled
										disabledColor="#ffffff" color="#666666" fontSize="32rpx">
									</u--input>
								</view>
							</view>
							<view class="content-item">
								<view class="content-item-left">预评估审核领导</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.priorEvaLeader" disabled
										disabledColor="#ffffff" color="#666666" fontSize="32rpx">
									</u--input>
								</view>
							</view>
							<view class="content-item">
								<view class="content-item-left">预评估时间</view>
								<view class="content-item-right">
									<u--input border="none" v-model="form.priorEvaDate" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item">
								<view class="content-item-left">预评估审核时间</view>
								<view class="content-item-right">
									<u--input border="none" v-model="form.priorEvaLeaderDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view> -->
							<view class="content-item">
								<view class="content-item-left"><span class="required">*</span>评估等级</view>
								<view class="content-item-right" @click="showPicker(Level,5)">
									<u--input border="none" v-model="picker.evaGrade" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16"
										style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item disabled">
								<view class="content-item-left ml35">评估负责人</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.evaPeople" color="#666666" fontSize="32rpx"
										disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
								</view>
							</view>
							<view class="content-item disabled">
								<view class="content-item-left ml35">评估时间</view>
								<view class="content-item-right">
									<u--input border="none" v-model="form.evaPeopleDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item disabled">
								<view class="content-item-left ml35">评估审核领导</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.evaCoLeader" color="#666666" fontSize="32rpx"
										disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
								</view>
							</view>
							<view class="content-item disabled">
								<view class="content-item-left ml35">评估审核时间</view>
								<view class="content-item-right">
									<u--input border="none" v-model="form.evaCoLeaderDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
						</view>
					</view>
				</swiper-item>
				<swiper-item v-if="form.currentState2 !=='ds_fq' && form.currentState2 !== 'sheng_fq'">
					<view class="information-change">
						<view class="content-view">
							<view class="content-item disabled">
								<view class="content-item-left ml35">职能部门负责人</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.functDeptPeople" color="#666666"
										fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
								</view>
							</view>
							<view class="content-item disabled">
								<view class="content-item-left ml35">部门负责人签字日期</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.functDeptPeopleDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#EFF2F2" inputAlign="right">
									</u--input>
								</view>
							</view>
						</view>
					</view>
				</swiper-item>
				<swiper-item v-if="form.currentState2 !=='ds_fq' && form.currentState2 !== 'sheng_fq'">
					<view class="information-change">
						<view class="content-view">
							<view class="content-item" @click="showPopupFn(1)">
								<view class="content-item-left"><span class="required">*</span>治理责任人</view>
								<view class="content-item-right">
									<u--input border="none" v-model="form.rnvPeople" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="showPopupWorkFn(1)">
								<view class="content-item-left"><span class="required">*</span>治理责任单位</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.rnvUnit" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="calendar(7)" v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left"><span class="required">*</span>治理期限起始日期</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.rnvStartDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item" @click="calendar(8)"v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left"><span class="required">*</span>治理期限终止日期</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.rnvEndDate" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item" @click="showPicker(isProject,6)" v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left"><span class="required">*</span>是否立项</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.isProject" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff" inputAlign="right">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="cont" v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left"><span class="required">*</span>治理方案</view>
								<view class="content-item-right pr50">
									<u--textarea v-model="form.treatmentPlan" autoHeight></u--textarea>
								</view>
							</view>
							<view class="cont" v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left">治理方案附件</view>
								<view>
									<view class="cob mt10" @click="checkAttac('080105')">查看附件列表</view>
									<files-upload @file="onUpload" classify="080105" :troubleId="form.troubleId">
									</files-upload>
								</view>
							</view>
							<view class="content-item" v-if="form.currentState2 !=='ds_ldhd' && form.currentState2 !== 'sheng_ldhd'">
								<view class="content-item-left">治理计划资金(万元)</view>
								<view class="content-item-right pr50">
									<u--input border="none" v-model="form.planMoney" color="#666666" inputAlign="right" fontSize="32rpx">
									</u--input>
								</view>
							</view>
						</view>
					</view>
				</swiper-item>
				<!-- <swiper-item v-if="false">
					<view class="information-change">
						<view class="content-view">
							<view class="content-item" @click="showPopupFn(2)">
								<view class="content-item-left">验收责任人</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caPeople" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="showPopupWorkFn(2)">
								<view class="content-item-left">验收申请单位</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caApplyUnit" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="calendar(3)">
								<view class="content-item-left">验收签字日期</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caPeopleDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item" @click="showPopupWorkFn(3)">
								<view class="content-item-left">验收组织单位</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caOrganizeUnit" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="showPopupFn(3)">
								<view class="content-item-left">验收组长</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caGroup" color="#666666" fontSize="32rpx"
										disabled disabledColor="#ffffff">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="content-item" @click="calendar(4)">
								<view class="content-item-left">验收组长签字日期</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.caGroupDate" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<image src="../../static/iconCalendar.png" class="Calendar"></image>
								</view>
							</view>
							<view class="content-item" @click="showPicker(isProject,6)">
								<view class="content-item-left">是否消除隐患</view>
								<view class="content-item-right">
									<u--input border="none" v-model="picker.isRemoveTrouble" color="#666666"
										fontSize="32rpx" disabled disabledColor="#ffffff">
									</u--input>
									<u-icon name="arrow-right" color="#333333" size="16" style="margin-left: 10rpx;">
									</u-icon>
								</view>
							</view>
							<view class="cont">
								<view class="content-item-left">验收意见</view>
								<view class="content-item-right pr50">
									<u--textarea v-model="form.caOpinion" autoHeight></u--textarea>
								</view>
							</view>
							<view class="cont">
								<view class="content-item-left">验收结论</view>
								<view class="content-item-right pr50">
									<u--textarea v-model="form.caVerdict" autoHeight></u--textarea>
								</view>
							</view>
							<view class="cont">
								<view class="content-item-left">验收报告附件</view>
								<view>
									<view class="cob mt10" @click="checkAttac('080103')">查看附件列表</view>
									<files-upload @file="onUpload" classify="080103" :troubleId="form.troubleId">
									</files-upload>
								</view>
							</view>
						</view>
					</view>
				</swiper-item> -->
			</swiper>
			<view class="maintenance">
				<view class="flex" style="width: 100%;justify-content: space-around;">
					<view>
						<image src="../../static/iconAuditInformation.png" @click="navTo('auditOpinion')"></image>
						<view>审核信息</view>
					</view>
					<view>
						<image src="../../static/iconTransferInformation.png" @click="navTo('transferInformation')">
						</image>
						<view>流转信息</view>
					</view>
					<view>
						<image src="../../static/iconSave.png" @click="save"></image>
						<view>保存</view>
					</view>
					<view v-if="form.currentState2 != 'ds_ldhd' && form.currentState2 != 'sheng_ldhd'">
						<image src="../../static/iconSend.png" @click="showOPc"></image>
						<view>发送</view>
					</view>
				</view>
			</view>
			<changeWork :show="showPopupWork" :selfFlag="workSelfFlag" :wbFlag="wbFlag" @showPopup="showPopupWork=false" @listItem="listItemWork"></changeWork>
			<optionCard :show="showPopup" @showPopup="showPopup=false" :roleCode="roleCode" :selfFlag="selfFlag" @listItem="listItem"></optionCard>
			<optionCard :show="showfsr" @showPopup="showfsr=false" @listItem="listItemfs" :event="true"
				:roleCode="roleCode" :selfFlag="selfFlag">
			</optionCard>
			<u-calendar :show="show" mode="single" @close="show=false" @confirm="confirm"
				:defaultDate="defaultDateMultiple" :minDate="minDate" :maxDate="maxDate"></u-calendar>
			<u-picker :show="show1" :columns="columns" keyName="label" @confirm="sub" @cancel="show1=false"></u-picker>
		</view>
	</view>
</template>

<script>
	import optionCard from "./components/option-card.vue"
	import changeWork from "./components/change-work.vue"
	const d = new Date()
	const year = d.getFullYear()
	let month = d.getMonth() + 1
	month = month < 10 ? `0${month}` : month
	let date = d.getDate() + 0
	date = date < 10 ? `0${date}` : date
	export default {
		components: {
			optionCard,
			changeWork
		},
		data() {
			return {
				rules: {
					'troubleTitle': {
						type: 'string',
						required: true,
						message: '请填写隐患简题',
						trigger: ['blur', 'change']
					},
				},
				roleCode:'',
				selfFlag:'',
				wbFlag:'',
				workSelfFlag:'',
				watchBack: true,
				//字典
				dictList: [],
				//表单
				form: {
					troubleId: '', //隐患ID
					troubleTitle: '', //隐患简题
					troubleNum: '', //隐患编号
					troubleUnit: '', //隐患所在单位
					troubleUnitId: '', //隐患所在单位id
					zdGrade: '', //隐患等级
					specialtyAssort: '', //隐患类型
					troubleSource: '', //隐患来源
					createUser: '', //填报人
					createOrg: '', //填报人单位
					findPeople: '', //发现人
					hiddenDangerFindUserId: '', //发现人ID
					findPeopleUnit: '', //发现人单位
					createDate: '', //填报时间
					findDate: '', //发现时间
					troubleContent: '', //隐患内容
					attachFunctDept: '', //归属职能部门
					contentfid: '', //隐患报告
					priorEvaGrade: '', //预评估等级
					priorEvaPeople: '', //预评估负责人
					priorEvaLeader: '', //预评估审核领导
					priorEvaDate: '', //预评估时间
					priorEvaLeaderDate: '', //预评估审核时间
					evaGrade: '', //评估等级
					evaPeople: '', //评估负责人
					evaCoLeader: '', //评估审核领导
					evaPeopleDate: '', //评估时间
					evaCoLeaderDate: '', //评估审核时间
					functDeptPeople: '', //核定负责人
					functDeptPeopleDate: '', //核定日期
					rnvUnit: '', //治理责任单位
					rnvUnitId: '', //治理责任单位ID
					rnvPeople: '', //治理责任人
					rnvPeopleId: '', //治理责任人ID
					rnvStartDate: '', //治理期限起始日期
					rnvEndDate: '', //治理期限终止日期
					isProject: '', //是否立项
					treatmentPlan: '', //治理方案
					treatmentScheme: '', //治理方案附件
					planMoney: '', //治理计划资金(万元)
					caPeople: '', //验收负责人
					caPeopleDate: '', //验收负责人签字日期
					caApplyUnit: '', //验收申请单位
					caOrganizeUnit: '', //验收组织单位
					caOpinion: '', //验收意见
					caGroup: '', //验收组长
					caGroupDate: '', //验收组长签字日期
					isRemoveTrouble: '', //是否消除隐患(0否/1是)
					caVerdict: '', //验收结论
				},
				columns: [
					[]
				], //下拉框数据
				columnsIndex: 0, //下拉框复制下标
				typeList: [
					[]
				], //隐患类型下拉框
				bodyList: [
					[]
				], //隐患来源下拉框
				departmentList: [
					[]
				], //归属职能部门下拉框
				Level: [
					[]
				], //级别
				rnvUnit: [
					[]
				], //责任单位
				isProject: [
					[{
						label: '是',
						id: true
					}, {
						label: '否',
						id: false
					}]
				], //是否立项
				minDate: '', //最小时间
				maxDate: '', //最大时间
				defaultDateMultiple: [`${year}-${month}-${date}`], //默认时间
				dataType: '', //保养时间类型
				show: false, //日期选择显示
				show1: false, //下拉框显示
				showPopup: false, //显示选人弹框
				showPopupWork: false, //显示工作单位
				showfsr: false, //发送人弹框
				popupIndex1: 0, //选人弹框下标，0发现人，1治理责任人
				popupIndex2: 0, //选择部门弹窗下标，0发现人单位，1治理人单位
				current: 0, //三个页面滑动下标
				picker: {
					findDate: '',
					rnvStartDate: '',
					rnvEndDate: '',
					specialtyAssort: '',
					zdGrade: '',
					troubleSource: '',
					attachFunctDept: '',
					priorEvaGrade: '',
					evaGrade: '',
					rnvUnit: '',
					isProject: '',
					caPeople: '', //验收负责人
					caPeopleDate: '', //验收负责人签字日期
					caOrganizeUnit: '', //验收组织单位
					caOpinion: '', //验收意见
					caGroup: '', //验收组长
					caGroupDate: '', //验收组长签字日期
					isRemoveTrouble: '', //是否消除隐患(0否/1是)
					caApplyUnit: '', //验收申请单位
					caVerdict: '', //验收结论
				},
				noExceptionList: {} //
			}
		},
		onLoad(e) {
			if (e.item) {
				// console.log(e.item)
				let item = JSON.parse(e.item)
				// console.log(item)
				item.caPeopleDate = item.caPeopleDate ? item.caPeopleDate.slice(0, 10) : ''
				item.caGroupDate = item.caGroupDate ? item.caGroupDate.slice(0, 10) : ''
				item.updateDate = item.updateDate ? item.updateDate.slice(0, 10) : ''
				item.reportDate = item.reportDate ? item.reportDate.slice(0, 10) : ''
				item.functDeptPeopleDate = item.functDeptPeopleDate ? item.functDeptPeopleDate.slice(0, 10) : ''
				item.createDate = item.createDate ? item.createDate.slice(0, 10) : ''
				item.findDate = item.findDate ? item.findDate.slice(0, 10) : ''
				item.rnvStartDate = item.rnvStartDate ? item.rnvStartDate.slice(0, 10) : ''
				item.rnvEndDate = item.rnvEndDate ? item.rnvEndDate.slice(0, 10) : ''
				item.priorEvaDate = item.priorEvaDate ? item.priorEvaDate.slice(0, 10) : ''
				item.priorEvaLeaderDate = item.priorEvaLeaderDate ? item.priorEvaLeaderDate.slice(0, 10) : ''
				item.evaPeopleDate = item.evaPeopleDate ? item.evaPeopleDate.slice(0, 10) : this.defaultDateMultiple[0]
				item.evaCoLeaderDate = item.evaCoLeaderDate ? item.evaCoLeaderDate.slice(0, 10) : this.defaultDateMultiple[0]
				this.form = {
					...this.form,
					...item
				}
				// console.log(this.form)
			}
			if (e.dictList) {
				let dictList = JSON.parse(e.dictList)
				this.dictList = dictList
			}
			// #ifdef APP-PLUS
			var page = this.$mp.page.$getAppWebview();
			page.setStyle({
				popGesture: 'none'
			});
			// #endif
		},
		onShow() {
			this.getDictsByCode()
			this.createDate() //填报时间回显
		},
		methods: {
			async showOPc(){
				let params = {
					currentState2: this.form.currentState2,
					isRnvPeople: this.form.isRnvPeople,
					evaGrade:this.form.evaGrade,
					wsflag:this.form.wsflag
				}
				this.request(this.$api.getHiddenDangerUserRoleCode, params, "POST").then(({
					resultValue: res
				}) => {
					this.roleCode = res.roleCode
					this.selfFlag = res.selfFlag
					console.log(this.roleCode)
					this.showfsr = true
				})
			},
			//发送
			async listItemfs(e) {
				let arr = [{
					troubleId: this.form.troubleId,
					selectUserId: e.id,
					sendPersonId: e.id,
					currentState2: this.form.currentState2,
					evaGrade: this.form.evaGrade,
				}]
				// console.log(arr, 12345)
				// console.log(arr)
				this.save(1)
				// let res = await this.request(this.$api.checkUserPermission, arr, 'POST')
				// console.log(res)
				let res1 = await this.request(this.$api.sendInfo, arr, 'POST')
				uni.showToast({
					icon: "success",
					title: "发送成功"
				})
				setTimeout(() => {
					uni.navigateBack({
						delta: 2
					})
				}, 1000);
				this.showfsr = false
			},
			//保存
			async save(e) {
				// console.log('保存', JSON.stringify(this.form))
				console.log('保存', this.form)
				let res = await this.request(this.$api.hiddenInfoSave, this.form, 'POST')
				console.log(res)
				if (e != 1) {
					uni.showToast({
						icon: "success",
						title: "保存成功"
					})
				}
			},
			//选择框
			sub(e) {
				console.log(e.value[0])
				if (this.columnsIndex == 0) {
					this.form.zdGrade = e.value[0].id
					this.picker.zdGrade = e.value[0].label
					this.form.evaGrade = e.value[0].id
					this.picker.evaGrade = e.value[0].label
				} else if (this.columnsIndex == 1) {
					this.form.specialtyAssort = e.value[0].id
					this.picker.specialtyAssort = e.value[0].label
				} else if (this.columnsIndex == 2) {
					this.form.troubleSource = e.value[0].id
					this.picker.troubleSource = e.value[0].label
				} else if (this.columnsIndex == 3) {
					this.form.attachFunctDept = e.value[0].id
					this.picker.attachFunctDept = e.value[0].label
				} else if (this.columnsIndex == 4) {
					this.form.priorEvaGrade = e.value[0].id
					this.picker.priorEvaGrade = e.value[0].label
				} else if (this.columnsIndex == 5) {
					this.form.zdGrade = e.value[0].id
					this.picker.zdGrade = e.value[0].label
					this.form.evaGrade = e.value[0].id
					this.picker.evaGrade = e.value[0].label
				} else if (this.columnsIndex == 6) {
					this.form.isProject = e.value[0].id
					this.picker.isProject = e.value[0].label
				}
				this.show1 = false
			},
			//回显默认数据
			createDate() {
				console.log(this.form,666)
				this.form.evaGrade = this.form.evaGrade=='' ? this.form.zdGrade : this.form.evaGrade
				let obj = {
					specialtyAssort: this.form.specialtyAssort,
					troubleSource: this.form.troubleSource,
					attachFunctDept: this.form.attachFunctDept,
					priorEvaGrade: this.form.priorEvaGrade,
					evaGrade: this.form.evaGrade,
					zdGrade: this.form.zdGrade
				}
				let arr = []
				for (let k in obj) {
					this.dictList.forEach(item => {
						if (k == item.name) {
							item.values.forEach(i => {
								if (obj[k] == i.value) {
									arr.push({
										name: k,
										value: i.text
									})
								}
							})
						}
					})
				}
				console.log(arr, 666666)
				// console.log(this.picker, 123456, this.form)
				arr.forEach((item) => {
					if (item.name == "specialtyAssort") {
						this.picker.specialtyAssort = item.value
					} else if (item.name == "troubleSource") {
						// this.picker.troubleSource = item.value
					} else if (item.name == "attachFunctDept") {
						// this.picker.attachFunctDept = item.value
					} else if (item.name == "priorEvaGrade") {
						this.picker.priorEvaGrade = item.value
					} else if (item.name == "evaGrade") {
						this.picker.evaGrade = item.value
					} else if (item.name == "zdGrade") {
						this.picker.zdGrade = item.value
						this.picker.evaGrade = item.value
					}
				})
				let user = uni.getStorageSync('userInfo');
				this.form.functDeptPeople = user.userName
				this.form.evaPeopleId = this.form.evaPeopleId == '' ? user.userId : this.form.evaPeopleId
				this.form.evaPeople = this.form.evaPeople == '' ? user.userName : this.form.evaPeople
				this.form.evaCoLeader = this.form.evaCoLeader == '' ? user.userName : this.form.evaCoLeader
				this.form.functDeptPeopleDate = this.defaultDateMultiple[0]
				this.picker.rnvStartDate = this.form.rnvStartDate
				this.picker.rnvEndDate = this.form.rnvEndDate
				this.picker.rnvUnit = this.form.rnvUnit
				this.picker.findDate = this.form.findDate
				this.picker.isProject = this.form.isProject == 1 ? '是' : '否'
				this.picker.caPeople = this.form.caPeople //验收负责人
				this.picker.caPeopleDate = this.form.caPeopleDate //验收负责人签字日期
				this.picker.caOrganizeUnit = this.form.caOrganizeUnit //验收组织单位
				this.picker.caGroup = this.form.caGroup //验收组长
				this.picker.caGroupDate = this.form.caGroupDate //验收组长签字日期
				this.picker.isRemoveTrouble = this.form.isRemoveTrouble == 1 ? '是' : '否' //是否消除隐患(0否/1是)
				console.log(this.picker, 'this.picker')
			},
			//日期选择
			confirm(e) {
				if (e[0]) {
					let dateNum = new Date(e[0]).getTime()
					if (this.dataType == 2) {
						this.picker.findDate = e[0]
						this.form.findDate = e[0]
					} else if (this.dataType == 3) {
						this.picker.caPeopleDate = e[0]
						this.form.caPeopleDate = e[0]
					} else if (this.dataType == 4) {
						this.picker.caGroupDate = e[0]
						this.form.caGroupDate = e[0]
					} else if (this.dataType == 7) {
						this.picker.rnvStartDate = e[0]
						this.form.rnvStartDate = e[0]
					} else if (this.dataType == 8) {
						this.picker.rnvEndDate = e[0]
						this.form.rnvEndDate = e[0]
					}
					this.show = false
					this.defaultDateMultiple[0] = e[0]
				} else {
					let dateNum = new Date(this.defaultDateMultiple[0]).getTime()
					if (this.dataType == 2) {
						this.picker.findDate = this.defaultDateMultiple[0]
						this.form.findDate = this.defaultDateMultiple[0]
					} else if (this.dataType == 3) {
						this.picker.caPeopleDate = this.defaultDateMultiple[0]
						this.form.caPeopleDate = this.defaultDateMultiple[0]
					} else if (this.dataType == 4) {
						this.picker.caGroupDate = this.defaultDateMultiple[0]
						this.form.caGroupDate = this.defaultDateMultiple[0]
					} else if (this.dataType == 7) {
						this.picker.rnvStartDate = this.defaultDateMultiple[0]
						this.form.rnvStartDate = this.defaultDateMultiple[0]
					} else if (this.dataType == 8) {
						this.picker.rnvEndDate = this.defaultDateMultiple[0]
						this.form.rnvEndDate = this.defaultDateMultiple[0]
					}
					this.show = false
				}
			},
			//下拉框赋值
			async getDictsByCode() {
				let data = {}
				let arr = []
				data = {
					typeCode: "YHZY"
				} // 隐患类型下拉框
				let {
					resultValue: res
				} = await this.request(this.$api.getDictsByCode, data, "POST")
				// console.log('字典查询', res.items)
				res.items.forEach((item) => {
					this.typeList[0].push({
						label: item.dicName,
						id: item.dicCode
					})
				})
				data = {
					typeCode: "YH_GSZNBM"
				}; //归属职能部门下拉框
				let {
					resultValue: res1
				} = await this.request(this.$api.getDictsByCode, data, "POST")
				// console.log('字典查询', res1.items)
				res1.items.forEach((item) => {
					this.departmentList[0].push({
						label: item.dicName,
						id: item.dicCode
					})
				})
				data = {
					typeCode: "YHLY"
				}; //隐患来源下拉框
				let {
					resultValue: res2
				} = await this.request(this.$api.getDictsByCode, data, "POST")
				// console.log('字典查询', res2.items)
				res2.items.forEach((item) => {
					this.bodyList[0].push({
						label: item.dicName,
						id: item.dicCode
					})
				})
				data = {
					typeCode: "PGDJ"
				}; //隐患等级下拉框
				let {
					resultValue: res3
				} = await this.request(this.$api.getDictsByCode, data, "POST")
				// console.log('字典查询', res3.items)
				res3.items.forEach((item) => {
					this.Level[0].push({
						label: item.dicName,
						id: item.dicCode
					})
				})
			},
			//显示下拉框
			showPicker(e, index) {
				this.columns = e
				this.columnsIndex = index
				this.show1 = true
			},
			// 点击显示日期组件
			calendar(e) {
				if (e == 2) {
					this.maxDate = `${year+1}-${month}-${date}`
					this.minDate = `${year}-${month-6}-${date}`
				} else {
					this.maxDate = `${year}-${month}-${date + 60}`
					this.minDate = `${year}-${month}-${date}`
				}
				this.dataType = e
				this.show = true
			},
			//选择人弹框回调
			listItem(e) {
				console.log(e)
				this.roleCode = ''
				this.selfFlag = ''
				if (this.popupIndex1 == 0) {
					this.form.findPeople = e.userName //发现人
					this.form.hiddenDangerFindUserId = e.id //发现人ID
					// this.form.findPeopleUnit = e.unitPath //发现人单位
				} else if (this.popupIndex1 == 1) {
					this.form.rnvPeople = e.userName //治理责任人
					this.form.rnvPeopleId = e.id //治理责任人ID
				} else if (this.popupIndex1 == 2) {
					this.form.caPeople = e.id //验收责任人
					this.picker.caPeople = e.userName //验收责任人
				} else if (this.popupIndex1 == 3) {
					this.form.caGroup = e.id //验收组长
					this.picker.caGroup = e.userName //验收组长
				}
			},
			//单位弹窗回调
			listItemWork(e) {
				console.log(e)
				if (this.popupIndex2 == 0) {
					this.form.findPeopleUnit = e.orgName //发现人单位
					// this.form.hiddenDangerFindUserId = e.id //发现人ID
				} else if (this.popupIndex2 == 1) {
					this.picker.rnvUnit = e.orgName //治理责任人单位
					this.form.rnvUnit = e.orgName
					this.form.rnvUnitId = e.id //治理责任人单位ID
				} else if (this.popupIndex2 == 2) {
					this.picker.attachFunctDept = e.orgPath //职能归属部门单位
					this.form.attachFunctDept = e.orgPath //职能归属部门单位
					// this.form.caApplyUnit = e.id //职能归属部门ID
				} else if (this.popupIndex2 == 3) {
					this.picker.troubleUnit = e.orgName //隐患所在单位
					this.form.troubleUnit = e.orgName //隐患所在单位
					this.form.troubleUnitId = e.id //隐患所在单位ID
				}
			},
			//显示单位弹窗
			showPopupWorkFn(e) {
				console.log(1)
				if(e==3){
					this.selfFlag = ''
					this.wbFlag = '0'
				}else{
					this.selfFlag='1'
					this.wbFlag = ''
				}
				this.popupIndex2 = e
				this.showPopupWork = true
			},
			//显示填报人弹窗
			showPopupFn(e) {
				this.popupIndex1 = e
				if(e==1){
					let params = {
						currentState2: this.form.currentState2,
						evaGrade:this.form.zdGrade,
						isRnvPeople: 1
					}
					this.request(this.$api.getHiddenDangerUserRoleCode, params, "POST").then(({
						resultValue: res
					}) => {
						this.roleCode = res.roleCode
						this.selfFlag = res.selfFlag
						console.log(this.roleCode)
						this.showPopup = true
					})
				}else{
					this.showPopup = true
				}
			},
			//取消按钮
			goback() {
				uni.navigateBack()
			},
			//保养报告上传
			onUpload(e) {
				this.form.id = e.uuid
				// console.log(this.form.id)
			},
			// 页面滑动
			change(e) {
				this.current = e.detail.current
			},
			navTo(e) {
				uni.navigateTo({
					url: './' + e + '?item=' + JSON.stringify(this.form) + '&dictList=' + JSON.stringify(this
						.dictList)
				})
			},
			checkAttac(classify) {
				// console.log(classify + '\n' + this.form.troubleId)
				uni.navigateTo({
					url: './../checkTheAttachment/checkTheAttachment?classify=' + classify + '&connectId=' + this
						.form.troubleId
				})
			}
		}
	}
</script>

<style scoped>
	.information-change {
		min-height: 100vh;
		background: #F5F6F9;
		box-sizing: border-box;
		padding-bottom: 100rpx;
	}

	.content-view {
		background: white;
	}

	.content-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 28rpx 40rpx;
		padding-left: 20rpx;
		border-bottom: 2rpx solid #F5F5F5;
	}
	
	.cont {
		padding: 28rpx 40rpx;
		padding-left: 20rpx;
		border-bottom: 2rpx solid #F5F5F5;
	}

	.content-item-left {
		font-size: 32rpx;
		color: #333333;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		width: 280rpx;
	}

	.content-item-right {
		display: flex;
		flex: 1;
		font-size: 32rpx;
		color: #999;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
	}

	>>>.uni-input-input {
		text-align: right;
	}

	.password-desc {
		font-size: 28rpx;
		color: #999;
		padding: 28rpx 40rpx 0;
	}

	.btn-view {
		display: flex;
		justify-content: space-between;
		padding: 30rpx 0;
	}

	.btn-view .btn {
		height: 96rpx;
		border-radius: 8rpx;
	}

	.login-btn {
		box-sizing: border-box;
		width: 320rpx;
		height: 80rpx;
		line-height: 80rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		text-align: center;
		border-radius: 14rpx;
	}

	.but1 {
		border: 1px solid #3473F9;
		color: #3473F9;
	}

	.but2 {
		background-color: #3473F9;
		color: #FFFFFF;
	}

	.Calendar {
		margin-left: 10rpx;
		width: 44rpx;
		height: 44rpx;
	}

	.pdf {
		margin-top: 30rpx;
		width: 120rpx;
		height: 120rpx;
		background-size: 100%;
		background-repeat: no-repeat;
	}

	.maintenance {
		background-color: #FFFFFF;
		position: fixed;
		bottom: 0;
		height: 228rpx;
		width: 100%;
		box-shadow: 0 -1px 11px 0 rgba(0, 0, 0, 0.09);
		text-align: center;
		padding: 40rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-around;
	}

	swiper {
		background: #F5F6F9;
		min-height: 100vh !important;
	}

	swiper-item {
		height: calc(100vh - 228rpx) !important;
		overflow: auto !important;
	}

	>>>uni-swiper {
		background: #F5F6F9;
		min-height: 100vh !important;
	}

	>>>uni-swiper-item {
		height: calc(100vh - 228rpx) !important;
		overflow: auto !important;
	}

	.slot-icon {
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
		font-size: 28rpx;
		line-height: 60rpx;
		text-align: center;
		box-sizing: border-box;
	}

	.slot-xz {
		background-color: #3473F9;
		color: #fff;
	}

	.slot-wxz {
		border: 1px solid #969799;
		color: #969799;
	}

	>>>.u-text__value--main {
		color: #3473F9 !important;
	}

	>>>.u-form-item__body {
		padding: 0 !important;
	}

	>>>.u-form-item__body__right__message {
		text-align: right;
	}

	.maintenance image {
		width: 84rpx;
		height: 84rpx;
	}

	.maintenance view {
		font-family: PingFangSC-Regular;
		font-weight: Regular;
		font-size: 28rpx;
		color: #65717D;
	}

	>>>.u-border {
		border: none !important;
	}

	>>>.u-textarea {
		padding: 20rpx 0;
	}

	.cob {
		flex: 1;
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #3473F9;
	}
</style>
